const RouterHook = require('koa-router')
//放行接口
RouterHook.prototype.noAuth = function (rule) {
  if (!this.noAuthList) {
    this.noAuthList = []
  }
  if (rule) {
    this.noAuthList.push(rule);
  } else {
    this.noAuthList.push(this.stack.at(-1).path);
  }
  return this
}
module.exports = RouterHook